package com.yh.crystal.controller;

import java.nio.charset.Charset;
import java.util.Map;

import com.jfinal.kit.JsonKit;
import com.yh.crystal.AppInit;

import cn.hutool.core.codec.Base64;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;

public class HomeController extends com.jfinal.core.Controller {

	private static final cn.hutool.log.Log log = cn.hutool.log.LogFactory.get();

	private static final Map<String, Map<String, Object>> param = MapUtil.newHashMap(true);

	public HomeController() {
		param.putAll(AppInit.getParam());
	}

	public void index() {
		String str = StrUtil.repeat(" ", 100 + (int) System.currentTimeMillis() % 100000) + JsonKit.toJson(param);
		setAttr("param", Base64.encode(str, Charset.forName("UTF-8")));
		render("/index.html");
	}

}
